package com.whsxt.service.impl;

import com.whsxt.domain.User;
import com.whsxt.mapper.UserMapper;
import com.whsxt.service.IUserService;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.dubbo.config.annotation.Service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 贺炯
 * @since 2019-09-18
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IUserService {
	
	@Autowired
	private UserMapper userMapper;

	@Override
	public User getSelectOne(QueryWrapper<User> queryWrapper) {
		
		return userMapper.selectOne(queryWrapper);
	}

	@Override
	public User selectOneByLoginname(String loginname) {
		 QueryWrapper<User> queryWrapper = new QueryWrapper<User>();
		 queryWrapper.eq("loginname", loginname);
		User user = this.getSelectOne(queryWrapper);
		return user;
	}
	
	
}
